/*   1:    */ package org.intellij.images.options.impl;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.options.BaseConfigurableWithChangeSupport;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.Project;
import org.intellij.images.ImagesBundle;
import org.intellij.images.options.Options;
import org.intellij.images.options.OptionsManager;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */ 
/*  17:    */ public final class OptionsConfigurabe
/*  18:    */   extends BaseConfigurableWithChangeSupport
/*  19:    */   implements SearchableConfigurable, PropertyChangeListener
/*  20:    */ {
/*  21: 39 */   private static final String a = ImagesBundle.message("settings.page.name", new Object[0]);
/*  22:    */   private OptionsUIForm b;
/*  23:    */   
/*  24:    */   public String getDisplayName()
/*  25:    */   {
/*  26: 43 */     return a;
/*  27:    */   }
/*  28:    */   
/*  29:    */   public String getHelpTopic()
/*  30:    */   {
/*  31: 47 */     return "preferences.images";
/*  32:    */   }
/*  33:    */   
/*  34:    */   public JComponent createComponent()
/*  35:    */   {
/*  36: 51 */     if (this.b == null)
/*  37:    */     {
/*  38: 52 */       this.b = new OptionsUIForm();
/*  39: 53 */       Options localOptions = OptionsManager.getInstance().getOptions();
/*  40: 54 */       localOptions.addPropertyChangeListener(this);
/*  41: 55 */       this.b.getOptions().inject(localOptions);
/*  42: 56 */       this.b.updateUI();
/*  43: 57 */       this.b.getOptions().addPropertyChangeListener(this);
/*  44: 58 */       setModified(false);
/*  45:    */     }
/*  46: 60 */     return this.b.getContentPane();
/*  47:    */   }
/*  48:    */   
/*  49:    */   public void apply()
/*  50:    */   {
/*  51: 64 */     if (this.b != null)
/*  52:    */     {
/*  53: 65 */       Options localOptions = OptionsManager.getInstance().getOptions();
/*  54: 66 */       localOptions.inject(this.b.getOptions());
/*  55:    */     }
/*  56:    */   }
/*  57:    */   
/*  58:    */   public void reset()
/*  59:    */   {
/*  60: 71 */     if (this.b != null)
/*  61:    */     {
/*  62: 72 */       Options localOptions = OptionsManager.getInstance().getOptions();
/*  63: 73 */       this.b.getOptions().inject(localOptions);
/*  64: 74 */       this.b.updateUI();
/*  65:    */     }
/*  66:    */   }
/*  67:    */   
/*  68:    */   public void disposeUIResources()
/*  69:    */   {
/*  70: 79 */     if (this.b != null)
/*  71:    */     {
/*  72: 80 */       Options localOptions = OptionsManager.getInstance().getOptions();
/*  73: 81 */       localOptions.removePropertyChangeListener(this);
/*  74: 82 */       this.b.getOptions().removePropertyChangeListener(this);
/*  75: 83 */       this.b = null;
/*  76:    */     }
/*  77:    */   }
/*  78:    */   
/*  79:    */   public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
/*  80:    */   {
/*  81: 88 */     Options localOptions1 = OptionsManager.getInstance().getOptions();
/*  82: 89 */     Options localOptions2 = this.b.getOptions();
/*  83:    */     
/*  84: 91 */     setModified(!localOptions1.equals(localOptions2));
/*  85:    */   }
/*  86:    */   
/*  87:    */   public static void show(Project paramProject)
/*  88:    */   {
/*  89: 95 */     ShowSettingsUtil localShowSettingsUtil = ShowSettingsUtil.getInstance();
/*  90: 96 */     localShowSettingsUtil.editConfigurable(paramProject, new OptionsConfigurabe());
/*  91:    */   }
/*  92:    */   
/*  93:    */   @NotNull
/*  94:    */   @NonNls
/*  95:    */   public String getId()
/*  96:    */   {
/*  97:102 */     String tmp2_0 = "Images";
/*  98:102 */     if (tmp2_0 == null) {
/*  99:102 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/images/options/impl/OptionsConfigurabe", "getId" }));
/* 100:    */     }
/* 101:102 */     return tmp2_0;
/* 102:    */   }
/* 103:    */   
/* 104:    */   @Nullable
/* 105:    */   public Runnable enableSearch(String paramString)
/* 106:    */   {
/* 107:107 */     return null;
/* 108:    */   }
/* 109:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.options.impl.OptionsConfigurabe

 * JD-Core Version:    0.7.0.1

 */